package com.ppx.life.mapping;

import com.ppx.life.dao.Bill;
import com.ppx.life.dao.BillExample;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface BillMapper {
    int countByExample(BillExample example);

    int deleteByExample(BillExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Bill record);

    int insertSelective(Bill record);

    List<Bill> selectByExample(BillExample example);

    Bill selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Bill record, @Param("example") BillExample example);

    int updateByExample(@Param("record") Bill record, @Param("example") BillExample example);

    int updateByPrimaryKeySelective(Bill record);

    int updateByPrimaryKey(Bill record);

    int addBills(List<Bill> bills,Integer user_id);

    //查询总共的菜单信息
    List<Map<String,Object>> selectBillsList(@Param("userId")int userId,
                                           @Param("indexPage")int indexPage,
                                           @Param("pageSize")int pageSize);

    //插入总商品信息

    int insertBills(@Param("date")String date,
                    @Param("commodity_names")String commodity_names,
                    @Param("total_price")double total_price,
                    @Param("userId")int userId);

    //查询该日期是否已存在
    int selectDataFromBills(@Param("date")String date);

    //查询该日期的记录，修改用
    Map<String,Object> selectBillsByDate(@Param("date")String date);

    //根据bills中的date查询那一天的商品信息
    List<Map<String ,Object>> selectBillListByDate(String date);
}